@echo off
setlocal enabledelayedexpansion 
cd %~dp0

rem withoutUWP, with headset mic Senary APO and PortC Senary APO
powershell "Get-PnpDevice -FriendlyName '*audio*'|Select-Object -Property HardwareID"|findstr /i "14F10238 14F10239 14F10345 1E508018 1E508017 14F10356 14F1032A 05266002 14F10230 14F10341 14F10349 14F10330 14F10343 14F1034D 14F10336 14F10337 14F10348 14F1033B 14F1033C"
if !errorlevel!==0 goto Install-ATN1

rem withoutUWP, with headset mic Senary APO and Intel dmic Senary APO
powershell "Get-PnpDevice -FriendlyName '*audio*'|Select-Object -Property HardwareID"|findstr /i 14F10227
if !errorlevel!==0 goto Install-DN39B2

rem with UWP and without Senary APO
powershell "Get-PnpDevice -FriendlyName '*audio*'|Select-Object -Property HardwareID"|findstr /i "278212C2 278212C3 1D05120A 1D05120b 1D05120c 1D05120d 104310A3 10431313 1D05124A 1D05124C 1D05124E 1D05124F 1D05126A"
if !errorlevel!==0 goto Install-MRID6-ASUS

rem withUWP, with headset mic Senary APO and Intel dmic Senary APO
powershell "Get-PnpDevice -FriendlyName '*audio*'|Select-Object -Property HardwareID"|findstr /i "1EC91A01 1EC91A04 1E39B991 1E39A991"
if !errorlevel!==0 goto Install-Haier

rem only install base and oem ext infs
call Install_scripts\Install.bat
cd %~dp0
goto end

:Install-ATN1
call Install_scripts\Install-ATN1.bat
cd %~dp0
goto end
:Install-DN39B2
call Install_scripts\Install-DN39B2.bat
cd %~dp0
goto end

:Install-MRID6-ASUS
call Install_scripts\Install-MRID6-ASUS.bat
cd %~dp0
goto end

:Install-Haier
echo pnputil /add-driver "cisstrtU-base.inf" /install
pnputil /add-driver "cisstrtU-base.inf" /install
echo pnputil /add-driver "cisstrtU-ext-OEM-common.inf" /install
pnputil /add-driver "cisstrtU-ext-OEM-common.inf" /install
echo pnputil /add-driver ".\SynaAPO\cisstrtU-component-OEM.inf" /install
pnputil /add-driver ".\SynaAPO\cisstrtU-component-OEM.inf" /install
echo pnputil /add-driver ".\SynaAPO\AudioService.inf" /install
pnputil /add-driver ".\SynaAPO\AudioService.inf" /install
pnputil /add-driver SenaryAPO/"SenaryAPO.inf" /install
pnputil /add-driver SenaryAPO/"IntcDMicExt_Senary.inf" /install

cd %~dp0

:end
